]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
iconGrid: Don't enter an infinite loop
authorJasper St. Pierre <jstpierre@mecheye.net>
Sat, 19 Nov 2011 20:27:36 +0000 (15:27 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Tue, 7 Feb 2012 22:40:22 +0000 (17:40 -0500)
If both spacing and -shell-grid-item-size are 0, as they would be with nothing
setting them, we enter an infinite loop where we try to compute the layout.
Avoid the situation entirely by defaulting -shell-grid-item-size to a sane
value instead of 0.

https://bugzilla.gnome.org/show_bug.cgi?id=662747

js/ui/iconGrid.js

index b93f6c01801bd3410a87584c49b7157c22a983bf..f893d5d276e37d4a8e87a6c1e8a31f88186fe4ec 100644 (file)
@@ -305,7 +305,7 @@ const IconGrid = new Lang.Class({
     _onStyleChanged: function() {
         let themeNode = this.actor.get_theme_node();
         this._spacing = themeNode.get_length('spacing');
-        this._item_size = themeNode.get_length('-shell-grid-item-size');
+        this._item_size = themeNode.get_length('-shell-grid-item-size') || ICON_SIZE;
         this._grid.queue_relayout();
     },